
(defun load-from-stream ()
  (with-input-from-string (in-stream "(this is a test)")
    (let ((l (read in-stream)))
      (format t "l = ~a~%" l)
      )
    ))

; =================================================
; reads a stream until nil met (or stream ends)
(defun load2 ()
  (with-input-from-string (in-stream "a b (c d) e")
    (do ((s (read in-stream nil) (read in-stream nil))) ((null s))
      (format t "s = ~a~%" s))))

; =================================================
; reads stream as well
(defun load3 ()
  (format t "~%#~4tExpression~20tType~%")
  (format t "============================~%")
  (with-input-from-string (in-stream "a b (c d) nil t 1 12 'utter 2/3 3.0 e")
    (loop for expr = (read in-stream nil 'eof)
          for pos from 1
          until (eq expr 'eof)
          do (format t "~a~4t~a~20t~a~%" pos expr (type-of expr))))
  (format t "============================~%"))


(defun main ()
  (format t "asd2")
  )

